BIN=test
CC=gcc
FLAGS=-c
LFLAGS=-o
SRC=test.c
OBJ=test.o
RM=rm -rf

$(BIN):$(OBJ)
	@$(CC) $(LFLAGS) $@ $^
	@echo "link... $^ to $@"
%.o:%.c
	@$(CC) $(FLAGS) $<
	@echo "all $< to $@"
#	$(CC) $(LFLAGS) $(BIN) $(SRC)
#$(OBJ):$(SRC)
#	$(CC) $(FLAGS) $@ $^

.PHONY:
clean:
	$(RM) $(BIN) $(OBJ)
